package com.hitrust.gs.dao;

import com.hitrust.gs.bean.GSHandleRecord;
import com.hitrust.gs.lib.db.GSBaseDAO;
import com.hitrust.gs.util.exception.GSException;

public class GSHandleRecordDAO extends GSBaseDAO{

	private final String insertSql = " insert into handle_record ("+
	" action_info,"+
	" user_name,"+
	" user_id,"+
	" handle_time,"+
	" remark,"+
	" handle_class,"+
	" user_ip,"+
	" id"+
	") values (?,?,?,?,?,?,?,(select sys_guid() from dual))";
	
	public boolean insert (GSHandleRecord vo) throws GSException{
		String tSql = this.insertSql;
		Object[] tobj = new Object[7];
		tobj[0] = vo.getActionInfo();
        tobj[1] = vo.getUserName();
        tobj[2] = vo.getUserId();
        tobj[3] = vo.getHandleTime();
        tobj[4] = vo.getRemark();
        tobj[5] = vo.getHandleClass();
        tobj[6] = vo.getUserIP();
		try {
			return this.executeUpdate(tSql, tobj);
		} catch (Exception e) {
			throw new GSException(GSException.E20042,GSException.E20042_MSG);
		}
	}
}
